﻿using System.Collections.Generic;
using JetBrains.ReSharper.Psi.CSharp.Tree;
using Twins.Interface;
using Twins.Interface.IHandler;

namespace Twins.Classes.Hanlder.HanlderExpression
{
    public class HanlderForIAdditiveExpression : IHandler<IAdditiveExpression>
    {
        public IEnumerable<ILineCode> DoFor(IAdditiveExpression additiveExpression)
        {
            var receiveHashLineCodeBinaryExpression = new ReceiveHashLineCodeBinaryExpression();
            var hashLineCode = receiveHashLineCodeBinaryExpression.ReceiveHashLineCode(additiveExpression);
            return new List<ILineCode> { new LineCode(additiveExpression, hashLineCode) };
        }

        public IEnumerable<ILineCode> DoFor(object obj)
        {
            return DoFor((IAdditiveExpression)obj);
        }
    }
}